import {request} from '../request'
import {get} from '../get'

export const getDict = () => {
  return get.get('/dict')
}

export const getDictLevel1 = () => {
  return get.get('/dict/level1')
}

export const addDict = (code, name) => {
  return request.post(`/dict/${code}`, {
    name: name
  })
}

export const updateDict = (code, name) => {
  return request.put(`/dict/${code}`, {
    name: name
  })
}

export const deleteDict = (code) => {
  return request.delete(`/dict/${code}`)
}
